// config

var app =
    angular.module('app')
        .config(
            ['$controllerProvider', '$compileProvider', '$filterProvider', '$provide',
                function ($controllerProvider, $compileProvider, $filterProvider, $provide) {

                    // lazy controller, directive and service
                    app.controller = $controllerProvider.register;
                    app.directive = $compileProvider.directive;
                    app.filter = $filterProvider.register;
                    app.factory = $provide.factory;
                    app.service = $provide.service;
                    app.constant = $provide.constant;
                    app.value = $provide.value;
                }
            ])
        .config(['$translateProvider', function ($translateProvider) {
            // Register a loader for the static files
            // So, the module will search missing translation tables under the specified urls.
            // Those urls are [prefix][langKey][suffix].
            $translateProvider.useStaticFilesLoader({
                prefix: 'l10n/',
                suffix: '.json'
            });
            // Tell the module what language to use by default
            $translateProvider.preferredLanguage('en');
            // Tell the module to store the language in the local storage
            $translateProvider.useLocalStorage();
        }])
        .config(["$provide",function($provide){

            //配置菜单
            //0子菜单，1是菜单类别，2是文字说明，3是分割线

            $provide.constant("$menus",[{
                "text": "navacation",
                "type": "2",
                "translate": "aside.nav.HEADER"
            }, {
                "text": "Pages",
                "translate": "aside.nav.components.pages.PAGES",
                "type": "1",
                "icon": "glyphicon glyphicon-file icon",
                "state": "app.page",
                "children": [{
                    "text": "Pages",
                    "translate": "aside.nav.components.pages.PAGES",
                    "type": "0",
                    "icon": "glyphicon glyphicon-file icon",
                    "route": "app.page.profile"
                }, {
                    "text": "Pages",
                    "translate": "aside.nav.components.pages.PAGES",
                    "type": "0",
                    "icon": "glyphicon glyphicon-file icon",
                    "route": "app.page.profile"
                }]
            }]);
        }]);
